///引入共享头部
import '../../../common/shard.dart';


import '../../../utils/assets_picker.dart';

class AssetsPickerPage extends StatelessWidget {
	const AssetsPickerPage({Key? key}) : super(key: key);

	@override
	Widget build(BuildContext context) {
		return CustomCupertinoScaffold(
			titleText: "媒体选取和拍摄",
			navBackgroundColor: Theme.of(context).primaryColor,
			body: Column(
				children: [
					TextButton(
						onPressed: () async {
							final res=await AssetsPickerUtil.pickImages(context, 1);
							LogUtil.d(res,tag:'选取照片(单选)');
						},
						child: const Text("选取照片(单选)")
					),
					TextButton(
						onPressed: () async {
							final res=await AssetsPickerUtil.pickImages(context, 6);
							LogUtil.d(res,tag:'选取照片(多选)');
						},
						child: const Text("选取照片(多选)")
					),
					TextButton(
						onPressed: () async {
							final res=await AssetsPickerUtil.pickImageFromCamera(context);
							LogUtil.d(res,tag:'拍摄照片');
						},
						child: const Text("拍摄照片")
					),
					TextButton(
						onPressed: () async {
							final res=await AssetsPickerUtil.pickVideoFromCamera(context);
							LogUtil.d(res,tag:'拍摄视频');
						},
						child: const Text("拍摄视频")
					),
				],
			),
		);
	}
}
